<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Forget follower API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'ccr-post-forget-follower.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ccr-post-forget-follower.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ccr-post-forget-follower.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/ccr-post-forget-follower.html" rel="nofollow" target="_blank">../en/ccr-post-forget-follower.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="ccr-apis.html">Cross-cluster replication APIs</a></span>
»
<span class="breadcrumb-node">Forget follower API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="ccr-post-unfollow.html">« Unfollow API</a>
</span>
<span class="next">
<a href="ccr-get-follow-stats.html">Get follower stats API »</a>
</span>
</div>
<div class="section xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="ccr-post-forget-follower"></a>Forget follower API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ccr/apis/follow/post-forget-follower.asciidoc">edit</a><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</h2>
</div></div></div>

<p>Removes the follower retention leases from the leader.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ccr-post-forget-follower-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ccr/apis/follow/post-forget-follower.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">POST /&lt;leader_index&gt;/_ccr/forget_follower
{
  "follower_cluster" : "&lt;follower_cluster&gt;",
  "follower_index" : "&lt;follower_index&gt;",
  "follower_index_uuid" : "&lt;follower_index_uuid&gt;",
  "leader_remote_cluster" : "&lt;leader_remote_cluster&gt;"
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1436.console"></div>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0,
    "failures" : [ ]
  }
}</pre>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ccr-post-forget-follower-prereqs"></a>Prerequisites<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ccr/apis/follow/post-forget-follower.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
If the Elasticsearch security features are enabled, you must have <code class="literal">manage_leader_index</code>
index privileges for the leader index. For more information, see
<a class="xref" href="security-privileges.html" title="Security privileges">Security privileges</a>.
</li>
</ul>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ccr-post-forget-follower-desc"></a>Description<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ccr/apis/follow/post-forget-follower.asciidoc">edit</a>
</h3>
</div></div></div>
<p>A following index takes out retention leases on its leader index. These
retention leases are used to increase the likelihood that the shards of the
leader index retain the history of operations that the shards of the following
index need to execute replication. When a follower index is converted to a
regular index via the <a class="xref" href="ccr-post-unfollow.html" title="Unfollow API">unfollow API</a> (either via explicit
execution of this API, or implicitly via index lifecycle management), these retention leases are
removed. However, removing these retention leases can fail (e.g., if the remote
cluster containing the leader index is unavailable). While these retention
leases will eventually expire on their own, their extended existence can cause
the leader index to hold more history than necessary, and prevent index lifecycle management from
performing some operations on the leader index. This API exists to enable
manually removing these retention leases when the unfollow API was unable to do
so.</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>This API does not stop replication by a following index. If you use this
API targeting a follower index that is still actively following, the following
index will add back retention leases on the leader. The only purpose of this API
is to handle the case of failure to remove the following retention leases after
the <a class="xref" href="ccr-post-unfollow.html" title="Unfollow API">unfollow API</a> is invoked.</p>
</div>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ccr-post-forget-follower-path-parms"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ccr/apis/follow/post-forget-follower.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;leader_index&gt;</code>
</span>
</dt>
<dd>
(Required, string) The name of the leader index.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ccr-post-forget-follower-request-body"></a>Request body<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ccr/apis/follow/post-forget-follower.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">follower_cluster</code>
</span>
</dt>
<dd>
(Required, string) The name of the cluster containing the follower index.
</dd>
<dt>
<span class="term">
<code class="literal">follower_index</code>
</span>
</dt>
<dd>
(Required, string) The name of the follower index.
</dd>
<dt>
<span class="term">
<code class="literal">follower_index_uuid</code>
</span>
</dt>
<dd>
(Required, string) The UUID of the follower index.
</dd>
<dt>
<span class="term">
<code class="literal">leader_remote_cluster</code>
</span>
</dt>
<dd>
(Required, string) The alias (from the perspective of the cluster containing
the follower index) of the <a class="xref" href="modules-remote-clusters.html" title="Remote clusters">remote cluster</a>
containing the leader index.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ccr-post-forget-follower-examples"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ccr/apis/follow/post-forget-follower.asciidoc">edit</a>
</h3>
</div></div></div>
<p>This example removes the follower retention leases for <code class="literal">follower_index</code> from
<code class="literal">leader_index</code>.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">POST /leader_index/_ccr/forget_follower
{
  "follower_cluster" : "follower_cluster",
  "follower_index" : "follower_index",
  "follower_index_uuid" : "vYpnaWPRQB6mNspmoCeYyA",
  "leader_remote_cluster" : "leader_cluster"
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1437.console"></div>
<p>The API returns the following result:</p>
<div class="pre_wrapper lang-console-result">
<pre class="programlisting prettyprint lang-console-result">{
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0,
    "failures" : [ ]
  }
}</pre>
</div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="ccr-post-unfollow.html">« Unfollow API</a>
</span>
<span class="next">
<a href="ccr-get-follow-stats.html">Get follower stats API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>